package IT.Demo.Mapper;

import IT.Demo.Pojo.Brand;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface BrandMapper {

    @Select("select * from tb_brand")
    @ResultMap("BrandresultMap")
    List<Brand> selectAll();


    @Insert(" insert into tb_brand values(null,#{brand_name},#{company_name},#{ordered},#{description},#{status});")
    @ResultMap("BrandresultMap")
    void add(Brand brand);

    @ResultMap("BrandresultMap")
    void deleteByids(@Param("ids") int[] ids);


    @Select("select * from tb_brand limit #{begin} , #{size}")
    @ResultMap("BrandresultMap")
    List<Brand> seletedByPage(@Param("begin") int begin,@Param("size")int  size);


    @Select("select count(*) from tb_brand")
    int totalCount();

    List<Brand> selectBypageAndCondition(@Param("begin") int begin,@Param("size")int  size, @Param("brand") Brand brand);


    int selectCountBypage(Brand brand);


}
